<?php

namespace Bigspender\DefaultBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;

class SignUpType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
    	$builder->add(
            'name', 
            'text', 
            array(
                'required' => true, 
                'attr' => 
                    array(
                        'class' => 'form-control'
                    )
            )
        );

        $builder->add(
            'email', 
            'email', 
            array(
                'required' => true, 
                'attr' => 
                    array(
                        'class' => 'form-control'
                    )
            )
        );
        
        $builder->add(
            'password', 
            'repeated', 
            array(
                'type' => 'password',
                'required' => true,
                'invalid_message' => 'SIGN UP PASSWORD REPEAT MISMATCH ERROR',
                'options' => 
                    array(
                        'attr' => 
                            array(
                                'class' => 'form-control'
                            )
                    ),
                'first_options'  => 
                    array(
                        'label' => 'SIGN UP PASSWORD LABEL'
                    ),
                'second_options' => 
                    array(
                        'label' => 'SIGN UP PASSWORD REPEAT LABEL'
                    ),
            )
        );

        $builder->add(
            'send', 
            'submit', 
            array(
                'attr' => 
                    array(
                        'class' => 'btn btn-success'
                    )
            )
        );
    }

    public function getName()
    {
        return 'signup';
    }
}
